<?php 

namespace Admin\Controller;
use Think\Controller;
class CommentsController extends BaseController{

public function CommentsList(){

			$commentsModel=M('comments');
			$comments=$commentsModel->order('cid')->select();
			$this->comments=$comments;
			$this->display();		   
}
public function deluser($id){
		//$id = $_GET['id'];
	$commentsModel=M('comments');
	$res=$commentsModel->where("cid=$id")->find();
	//echo $res->getLastSql();
       $photoPath=realpath('./Public/Admin/photo/'.$res['photo']);
        if($res['photo']!=='default.jpg')
        {
        unlink($photoPath);}

	if(false!==$commentsModel->where("cid=$id")->delete())
		$this->success('删除成功！');
	else
		{ $this->error('删除失败');
	}
	   
}



}


 ?>